<?xml version="1.0"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" creator="Teslamate" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
    <trk>
        <name><%= DateTime.to_iso8601(@drive.start_date) %></name>
        <trkseg>
            <%= for position <- @drive.positions do %>
            <trkpt lat="<%= position.latitude %>" lon="<%= position.longitude %>">
                <%= if not is_nil(position.elevation) do %>
                <ele><%= position.elevation %></ele>
                <% end %>
                <time><%= DateTime.to_iso8601(position.date) %></time>
            </trkpt>
            <% end %>
        </trkseg>
    </trk>
</gpx>